﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GroupManage.aspx.cs" Inherits="Trangtrai.tochuc.GroupManage" MasterPageFile="~/SiteMaster.Master" %>
<%@ Register assembly="DevExpress.Web.ASPxEditors.v11.1, Version=11.1.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.ASPxGridView.v11.1, Version=11.1.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView" tagprefix="dx" %>

<asp:Content ID="Content3" runat="server" contentplaceholderid="head">

    <script type="text/javascript" src="../../js/jquery-latest.js"></script>
    <script type="text/javascript">
        $(document).ready(function() {

            $("ul.subnav").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled - Adds empty span tag after ul.subnav

            $("ul.topnav li span").click(function() { //When trigger is clicked...

                //Following events are applied to the subnav itself (moving subnav up and down)
                $(this).parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click

                $(this).parent().hover(function() {
                }, function() {
                    $(this).parent().find("ul.subnav").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
                });
                ;
                //Following events are applied to the trigger (Hover events for the trigger)
            }).hover(function() {
                $(this).addClass("subhover"); //On hover over, add class "subhover"
            }, function() {	//On Hover Out
                $(this).removeClass("subhover"); //On hover out, remove class "subhover"
            });

        });
    </script>
    <style type="text/css">
        .style1
        {
            width: 140px;
        }
        .style2
        {
            width: 112px;
        }
        .style3
        {
            width: 242px;
        }
        .style4
        {
            width: 178px;
        }
        .style6
        {
            width: 506px;
        }
    </style>

</asp:Content>


<asp:Content ID="Content1" runat="server" 
    contentplaceholderid="ContentPlaceHolder1">
    <center>
        <table width="960px" runat="server">
            <tr>
                <td align="left" class="style6">
                    <dx:ASPxLabel ID="lblMess" runat="server" Text="" Visible="false" ForeColor="#FF3300">
                    </dx:ASPxLabel>
                </td>
            </tr>
            <tr>
                <td align="center" bgcolor="#94B6E8" class="style6">
                        
                    <dx:ASPxLabel ID="ASPxLabel1" runat="server" Text="QUẢN LÝ ĐỘI SẢN XUẤT" 
                        Font-Size="Large">
                    </dx:ASPxLabel>
                        
                </td>
            </tr>
            <tr>
                <td class="style6">
                
                    <dx:ASPxGridView ID="ASPxGridView1" runat="server" Width="960px"
                        AutoGenerateColumns="False" 
                        CssFilePath="~/App_Themes/Office2003Blue/{0}/styles.css" 
                        CssPostfix="Office2003Blue" onrowdeleting="ASPxGridView1_RowDeleting" 
                        onrowupdating="ASPxGridView1_RowUpdating" KeyFieldName="groupId" 
                        >
                        <SettingsBehavior AllowSelectByRowClick="True" />
                        <Styles CssFilePath="~/App_Themes/Office2003Blue/{0}/styles.css" 
                            CssPostfix="Office2003Blue">
                            <Header ImageSpacing="5px" SortingImageSpacing="5px">
                            </Header>
                            <LoadingPanel ImageSpacing="10px">
                            </LoadingPanel>
                        </Styles>
                        <ImagesFilterControl>
                            <LoadingPanel Url="~/App_Themes/Office2003Blue/Editors/Loading.gif">
                            </LoadingPanel>
                        </ImagesFilterControl>
                        <Images SpriteCssFilePath="~/App_Themes/Office2003Blue/{0}/sprite.css">
                            <LoadingPanelOnStatusBar Url="~/App_Themes/Office2003Blue/GridView/gvLoadingOnStatusBar.gif">
                            </LoadingPanelOnStatusBar>
                            <LoadingPanel Url="~/App_Themes/Office2003Blue/GridView/Loading.gif">
                            </LoadingPanel>
                        </Images>
                        <SettingsEditing PopupEditFormShowHeader="False" />
                        <Columns>
                            
                            <dx:GridViewDataTextColumn Caption="Mã đội" FieldName="groupCode" 
                                VisibleIndex="0">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn Caption="Tên đội" FieldName="groupName" 
                                VisibleIndex="1">
                            </dx:GridViewDataTextColumn>
                            
                            <dx:GridViewDataTextColumn Caption="Địa chỉ" FieldName="address" 
                                VisibleIndex="2">
                            </dx:GridViewDataTextColumn>
                            
                            <dx:GridViewDataTextColumn Caption="Đội trưởng" FieldName="groupLeader" 
                                VisibleIndex="3">
                            </dx:GridViewDataTextColumn>
                        </Columns>
                        <Settings ShowFilterRow="true"/>
                        <StylesEditors>
                            <ProgressBar Height="25px">
                            </ProgressBar>
                        </StylesEditors>
                    </dx:ASPxGridView>
                </td>
                
            </tr>
               <tr>
               <td align="left" class="style6" >
                    <table>
                        <tr>
                         <td>
                            <dx:ASPxButton ID="btnAddGroup" runat="server" 
                            CssFilePath="~/App_Themes/SoftOrange/{0}/styles.css" CssPostfix="SoftOrange" 
                            SpriteCssFilePath="~/App_Themes/SoftOrange/{0}/sprite.css" 
                            style="margin-right: 5px" Text="Thêm đội mới" Width="120px" onclick="btnAddGroup_Click" 
                            >
                       
                         </dx:ASPxButton>
                            </td>
                            <td>
                            <dx:ASPxButton ID="bntDetails" runat="server" 
                            CssFilePath="~/App_Themes/SoftOrange/{0}/styles.css" CssPostfix="SoftOrange" 
                            SpriteCssFilePath="~/App_Themes/SoftOrange/{0}/sprite.css" 
                            style="margin-right: 5px" Text="Chi tiết" Width="80px" onclick="bntDetails_Click" 
                            >
                       
                         </dx:ASPxButton>
                            </td>
                            <td align="left">
                                 <dx:ASPxButton ID="bntEdit" runat="server" 
                            CssFilePath="~/App_Themes/SoftOrange/{0}/styles.css" CssPostfix="SoftOrange" 
                            SpriteCssFilePath="~/App_Themes/SoftOrange/{0}/sprite.css" 
                            style="margin-right: 5px" Text="Sửa" Width="40px" onclick="bntEdit_Click" 
                            >
                       
                         </dx:ASPxButton>
                            </td>
                            <td align="left">
                             <dx:ASPxButton ID="bntDelete" runat="server" 
                            CssFilePath="~/App_Themes/SoftOrange/{0}/styles.css" CssPostfix="SoftOrange" 
                            SpriteCssFilePath="~/App_Themes/SoftOrange/{0}/sprite.css" 
                            style="margin-right: 5px" Text="Xóa" Width="40px" onclick="bntDelete_Click" 
                             >
                       
                         </dx:ASPxButton>
                            </td>
                        </tr>
                    </table>
                        
                         
                       
                         
               </td>
                
                
            </tr>
        
        </table>
       <table width="960px" id="tbAddDetails" visible="false" runat="server" bgcolor="White">
            <tr>
                <td colspan="5" bgcolor="#94B6E8" align="center">
                    <dx:ASPxLabel ID="lblCaption" runat="server" Text="Tạo đội mới" 
                        Font-Size="Large">
                    </dx:ASPxLabel>
                </td>
            </tr>
            <tr>
                <td class="style2"></td>
                <td class="style1" align="left" bgcolor="#94B6E8">
                    
                    <dx:ASPxLabel ID="ASPxLabel3" runat="server" Text="Tên đội">
                    </dx:ASPxLabel>
                    
                </td>
                <td class="style3" align="left">
                    <dx:ASPxTextBox ID="tbxGroupNewName" runat="server" Width="170px">
                    </dx:ASPxTextBox>
                </td>
                <td class="style4" align="left" bgcolor="#94B6E8">
                    <dx:ASPxLabel ID="ASPxLabel4" runat="server" Text="Địa chỉ">
                    </dx:ASPxLabel>
                </td>
                <td align="left"> 
                    <dx:ASPxTextBox ID="tbxAddress" runat="server" Width="170px">
                    </dx:ASPxTextBox>
                </td>
            </tr>
            <tr>
                <td colspan="5"><br /></td>
            </tr>
            <tr>
                <td class="style2"></td>
                <td class="style1" align="left" bgcolor="#94B6E8">
                    
                    <dx:ASPxLabel ID="ASPxLabel5" runat="server" Text="Mã đội">
                    </dx:ASPxLabel>
                    
                </td>
                <td class="style3" align="left">
                    <dx:ASPxTextBox ID="tbxGroupCode" runat="server" Width="170px">
                    </dx:ASPxTextBox>
                </td>
                <td class="style4" align="left" bgcolor="#94B6E8">
                    <dx:ASPxLabel ID="ASPxLabel6" runat="server" Text="Ghi chú">
                    </dx:ASPxLabel>
                </td>
                <td align="left"> 
                    <dx:ASPxTextBox ID="tbxGroupNote" runat="server" Width="170px">
                    </dx:ASPxTextBox>
                </td>
            </tr>
            <tr>
            <td></td>
                <td colspan="4" align="left">
                     <dx:ASPxButton ID="bntAddNew" runat="server" 
                            CssFilePath="~/App_Themes/SoftOrange/{0}/styles.css" CssPostfix="SoftOrange" 
                            SpriteCssFilePath="~/App_Themes/SoftOrange/{0}/sprite.css" 
                            style="margin-right: 5px" Text="Thêm nhân viên" Width="120px" onclick="bntAddNew_Click" 
                             />
                </td>
            </tr>
            <tr>
                <td colspan="5" align="center">
                    
                    <dx:ASPxGridView ID="ASPxGridView2" runat="server" Width="960px" Visible="false"
                        AutoGenerateColumns="False" 
                        CssFilePath="~/App_Themes/Office2003Blue/{0}/styles.css" 
                        CssPostfix="Office2003Blue" 
                        KeyFieldName="userId">
                        <Styles CssFilePath="~/App_Themes/Office2003Blue/{0}/styles.css" 
                            CssPostfix="Office2003Blue">
                            <Header ImageSpacing="5px" SortingImageSpacing="5px">
                            </Header>
                            <LoadingPanel ImageSpacing="10px">
                            </LoadingPanel>
                        </Styles>
                        <ImagesFilterControl>
                            <LoadingPanel Url="~/App_Themes/Office2003Blue/Editors/Loading.gif">
                            </LoadingPanel>
                        </ImagesFilterControl>
                        <Images SpriteCssFilePath="~/App_Themes/Office2003Blue/{0}/sprite.css">
                            <LoadingPanelOnStatusBar Url="~/App_Themes/Office2003Blue/GridView/gvLoadingOnStatusBar.gif">
                            </LoadingPanelOnStatusBar>
                            <LoadingPanel Url="~/App_Themes/Office2003Blue/GridView/Loading.gif">
                            </LoadingPanel>
                        </Images>
                        <Columns>
                            
                            <dx:GridViewDataTextColumn Caption="Số thứ tự" FieldName="userId" Width="20px"
                                ReadOnly="True" VisibleIndex="0">
                                <EditFormSettings Visible="False" />
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn Caption="Tên nhân viên" FieldName="fullName" 
                                VisibleIndex="1">
                            </dx:GridViewDataTextColumn>
                             <dx:GridViewDataTextColumn Caption="Chức vụ" FieldName="roleName" 
                                VisibleIndex="2">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewCommandColumn Caption="Chọn" ShowSelectCheckbox="True" 
                                VisibleIndex="3">
                                <ClearFilterButton Visible="True">
                                </ClearFilterButton>
                            </dx:GridViewCommandColumn>
                            
                        </Columns>
                        <Settings ShowFilterRow="True" />
                    </dx:ASPxGridView>
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td colspan="4" align="left" bgcolor="#94B6E8">
                    
                    <dx:ASPxButton ID="btnSelect" runat="server" Visible="false"
                        CssFilePath="~/App_Themes/SoftOrange/{0}/styles.css" CssPostfix="SoftOrange" 
                        SpriteCssFilePath="~/App_Themes/SoftOrange/{0}/sprite.css" 
                        style="margin-right: 60px" Text="Chọn nhân viên" Width="120px" 
                        onclick="btnSelect_Click"  >
                       
                    </dx:ASPxButton>
                </td>
            </tr>
            
             <!-- them list danh sach nhan vien da chon -->
             </br>
             <tr >
                <td></td>
                <td align="center"  colspan="5"  bgcolor="#94B6E8">
                        
                    <dx:ASPxLabel ID="ASPxLabel7" runat="server" Text="Danh sách nhân viên đã chọn" 
                        Font-Size="Large">
                    </dx:ASPxLabel>
                        
                </td>
            </tr>
            <tr>
                <td></td>
                <td colspan="4" align="left">
                    
                    <dx:ASPxGridView ID="dgvSelectedUsers" runat="server" Width="960px" 
                        AutoGenerateColumns="False" 
                        CssFilePath="~/App_Themes/Office2003Blue/{0}/styles.css" 
                        CssPostfix="Office2003Blue" 
                        KeyFieldName="userId" 
                        oncustombuttoncallback="dgvSelectedUsers_CustomButtonCallback">
                        <Styles CssFilePath="~/App_Themes/Office2003Blue/{0}/styles.css" 
                            CssPostfix="Office2003Blue">
                            <Header ImageSpacing="5px" SortingImageSpacing="5px">
                            </Header>
                            <LoadingPanel ImageSpacing="10px">
                            </LoadingPanel>
                        </Styles>
                        <ImagesFilterControl>
                            <LoadingPanel Url="~/App_Themes/Office2003Blue/Editors/Loading.gif">
                            </LoadingPanel>
                        </ImagesFilterControl>
                        <Images SpriteCssFilePath="~/App_Themes/Office2003Blue/{0}/sprite.css">
                            <LoadingPanelOnStatusBar Url="~/App_Themes/Office2003Blue/GridView/gvLoadingOnStatusBar.gif">
                            </LoadingPanelOnStatusBar>
                            <LoadingPanel Url="~/App_Themes/Office2003Blue/GridView/Loading.gif">
                            </LoadingPanel>
                        </Images>
                        <Columns>
                            <dx:GridViewDataTextColumn Caption="Số thứ tự" FieldName="userId" 
                                ReadOnly="True" VisibleIndex="0">
                                <EditFormSettings Visible="False" />
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn Caption="Tên nhân viên" FieldName="fullName" 
                                VisibleIndex="1">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewCommandColumn VisibleIndex="3" >
                                <CustomButtons>
                                    <dx:GridViewCommandColumnCustomButton ID="txtRemove" Text="Xóa">
                                    
                                    </dx:GridViewCommandColumnCustomButton>
                                </CustomButtons>
                            </dx:GridViewCommandColumn>
                            <dx:GridViewDataTextColumn Caption="Chức vụ" FieldName="roleName" 
                                VisibleIndex="2">
                            </dx:GridViewDataTextColumn>
                            
                        </Columns>
                        <StylesEditors>
                            <ProgressBar Height="25px">
                            </ProgressBar>
                        </StylesEditors>
                    </dx:ASPxGridView>
                </td>
            </tr>
            <!--luu group vao db-->
            
            <tr>
                <td></td>
                <td colspan="4" align="left" bgcolor="#94B6E8">
                    <dx:ASPxButton ID="btnSave" runat="server" 
                        CssFilePath="~/App_Themes/SoftOrange/{0}/styles.css" CssPostfix="SoftOrange" 
                        SpriteCssFilePath="~/App_Themes/SoftOrange/{0}/sprite.css" 
                        style="margin-right: 60px" Text="Lưu" Width="140px" 
                        onclick="btnSave_Click">
                    </dx:ASPxButton>
                </td>
            </tr>
       </table>
    
      
           
    </center>
</asp:Content>
